<!-----------------------------------------------------------------------------
-- 2013 All rights reserved
-- Project codename: FROMCOMA 
-- Date: 20sept2013
-- Author: A.A
-- Description: item page of FROMCOMA website.
-------------------------------------------------------------------------------
-- Changelog:
-- v0.1:	we're off.
-- 
------------------------------------------------------------------------------>
<?php 
/* Connecting to MySQL */
require 'sqlconn.inc.php';

/* Getting the item id */
$id = $_GET["id"];

/* Table */
$table = "items";
/* Query */
$result = mysql_query("SELECT * FROM $table WHERE id=$id");
/* Fetching  "to put where it belongs" */
	$row = mysql_fetch_array($result);
	$title = $row['title'];
	$url = $row['url'];
	$categoryId = $row['category'];
	$date = $row['date'];
	
$categories = mysql_query("SELECT * FROM categories WHERE id=$categoryId");
	$row = mysql_fetch_array($categories);
	$category = $row['name'];



?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>FROMCOMA</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="style.css" />
	<link rel="stylesheet" type="text/css" href="style-item.css" />

</head>
<body>
<div id="header-bar">here goes the title | <a href="upload.php">upload</a> | <a href="category.php">category</a></div>
<div id="content">
<a href="index.php">< Back </a>
<a href="item.php?id=<?php echo $id; ?>">
<div id="oneitem">
	<div class="img">
	<img src="uploads/<?php echo $url; ?>" class="img">
	</div>
	<div class="info">
	<h1><?php echo $title; ?></h1><br>
	<?php echo $category; ?><br>
	<?php echo $date; ?>
	</div>
</div>
</a>

</div>
</body>
</html>